package com.zline.foodraise.view;

import android.content.Context;
import android.support.v4.widget.SwipeRefreshLayout;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.ViewGroup;

import com.zline.foodraise.listener.CanChildScrollUpCallback;
import com.zline.foodraise.util.LUtil;

/**
 * Created by heshantao on 15/12/2.
 */
public class ScrollSwipeRefreshLayout extends SwipeRefreshLayout {
    private static final String LOG_TAG = ScrollSwipeRefreshLayout.class.getSimpleName();
    private CanChildScrollUpCallback mCanChildScrollUpCallback;

    public ScrollSwipeRefreshLayout(Context context) {
        super(context);
    }

    public ScrollSwipeRefreshLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public void setCanChildScrollUpCallback(CanChildScrollUpCallback canChildScrollUpCallback) {
        mCanChildScrollUpCallback = canChildScrollUpCallback;
    }


    @Override
    public boolean canChildScrollUp() {
        if (mCanChildScrollUpCallback != null) {
            return mCanChildScrollUpCallback.canSwipeRefreshChildScrollUp();
        }
        return super.canChildScrollUp();
    }


}
